inherited frmMachiningCostPriceAnalyse: TfrmMachiningCostPriceAnalyse
  Left = 344
  Top = 126
  Caption = #29983#20135#25104#26412#25253#20215#20998#26512
  PixelsPerInch = 96
  TextHeight = 12
  inherited Panel1: TPanel
    Width = 782
    Height = 65
    Align = alTop
    Visible = True
    inherited img3: TImage
      Left = 709
      Top = 14
      Visible = False
    end
    inherited labFuncName: TcxLabel
      Left = 8
      Top = 13
      Caption = #23458#25143#21517#31216
      Style.IsFontAssigned = True
    end
    inherited labFuncDesc: TcxLabel
      Left = 220
      Top = 13
      Style.IsFontAssigned = True
      Visible = False
    end
    object edtClient: TcxDBLookupComboBox
      Tag = 8
      Left = 60
      Top = 11
      DataBinding.DataField = 'traderid'
      DataBinding.DataSource = dsClient
      Properties.CaseSensitiveSearch = True
      Properties.DropDownSizeable = True
      Properties.GridMode = True
      Properties.ImmediatePost = True
      Properties.ListColumns = <>
      Properties.PostPopupValueOnTab = True
      TabOrder = 0
      Width = 145
    end
    object btnFilter: TcxButton
      Left = 606
      Top = 9
      Width = 75
      Height = 25
      Caption = #36807#28388
      TabOrder = 3
      OnClick = btnFilterClick
      DropDownMenu = pmSelSOrder
      Kind = cxbkDropDownButton
      LookAndFeel.Kind = lfUltraFlat
    end
    object cxLabel2: TcxLabel
      Left = 242
      Top = 13
      Caption = #36215#22987#26085#26399
    end
    object cxLabel3: TcxLabel
      Left = 425
      Top = 13
      Caption = #25130#27490#26085#26399
    end
    object edtSDate: TcxDateEdit
      Left = 294
      Top = 12
      Properties.DateButtons = [btnToday]
      Properties.ImmediatePost = True
      Properties.SaveTime = False
      Properties.ShowTime = False
      TabOrder = 1
      Width = 121
    end
    object edtEDate: TcxDateEdit
      Left = 479
      Top = 12
      Properties.DateButtons = [btnToday]
      Properties.ImmediatePost = True
      Properties.SaveTime = False
      Properties.ShowTime = False
      TabOrder = 2
      Width = 121
    end
    object cxLabel1: TcxLabel
      Left = 8
      Top = 39
      Caption = #25171#26679#20135#21697
      ParentFont = False
      Style.Font.Charset = GB2312_CHARSET
      Style.Font.Color = clWhite
      Style.Font.Height = -12
      Style.Font.Name = #23435#20307
      Style.Font.Style = []
      Style.IsFontAssigned = True
    end
    object edtProductBom: TcxDBLookupComboBox
      Tag = 10
      Left = 60
      Top = 37
      DataBinding.DataField = 'productid'
      DataBinding.DataSource = dsClient
      Properties.CaseSensitiveSearch = True
      Properties.DropDownSizeable = True
      Properties.GridMode = True
      Properties.ImmediatePost = True
      Properties.ListColumns = <>
      Properties.PostPopupValueOnTab = True
      TabOrder = 9
      Width = 145
    end
  end
  object pgcClient: TcxPageControl [3]
    Left = 0
    Top = 65
    Width = 782
    Height = 413
    ActivePage = tsSaleOrderInfo
    Align = alClient
    TabOrder = 1
    OnChange = pgcClientChange
    ClientRectBottom = 413
    ClientRectRight = 782
    ClientRectTop = 23
    object tsSaleOrderInfo: TcxTabSheet
      Caption = #25253#20215#21333#20449#24687
      ImageIndex = 0
      object pnlBillInfo: TPanel
        Left = 0
        Top = 0
        Width = 360
        Height = 390
        Align = alLeft
        BevelOuter = bvNone
        TabOrder = 0
        object grdSaleOrder: TcxGrid
          Left = 0
          Top = 0
          Width = 360
          Height = 120
          Align = alTop
          TabOrder = 0
          object viewSaleOrder: TcxGridDBTableView
            NavigatorButtons.ConfirmDelete = False
            OnCellDblClick = viewSaleOrderCellDblClick
            DataController.DataSource = dsSaleOrder
            DataController.Summary.DefaultGroupSummaryItems = <>
            DataController.Summary.FooterSummaryItems = <>
            DataController.Summary.SummaryGroups = <>
            OptionsData.Appending = True
            OptionsView.GroupByBox = False
            OptionsView.Indicator = True
            OptionsView.IndicatorWidth = 25
            OnCustomDrawIndicatorCell = viewSaleOrderCustomDrawIndicatorCell
            object viewSaleOrderchoice: TcxGridDBColumn
              DataBinding.FieldName = 'choice'
              PropertiesClassName = 'TcxCheckBoxProperties'
              Properties.ImmediatePost = True
              Width = 30
            end
          end
          object lvlSaleOrder: TcxGridLevel
            Caption = #25253#20215#21333#20449#24687
            GridView = viewSaleOrder
          end
        end
        object pgcDtl: TcxPageControl
          Left = 0
          Top = 128
          Width = 360
          Height = 262
          ActivePage = tsSaleOrderDtl
          Align = alClient
          TabOrder = 1
          OnChange = pgcDtlChange
          ClientRectBottom = 262
          ClientRectRight = 360
          ClientRectTop = 23
          object tsSaleOrderDtl: TcxTabSheet
            Caption = #25171#26679#36135#21697
            ImageIndex = 0
            object grdSaleOrderDtl: TcxGrid
              Left = 0
              Top = 0
              Width = 360
              Height = 239
              Align = alClient
              TabOrder = 0
              object viewSaleOrderDtl: TcxGridDBTableView
                OnDblClick = btnBomClick
                NavigatorButtons.ConfirmDelete = False
                DataController.DataSource = dsSaleOrderDtl
                DataController.Summary.DefaultGroupSummaryItems = <>
                DataController.Summary.FooterSummaryItems = <>
                DataController.Summary.SummaryGroups = <>
                OptionsView.GroupByBox = False
                OptionsView.Indicator = True
                OptionsView.IndicatorWidth = 25
                OnCustomDrawIndicatorCell = viewSaleOrderCustomDrawIndicatorCell
                object viewSaleOrderDtlchoice: TcxGridDBColumn
                  Caption = #36873#25321
                  DataBinding.FieldName = 'choice'
                  PropertiesClassName = 'TcxCheckBoxProperties'
                  HeaderAlignmentHorz = taCenter
                  Width = 30
                end
                object viewSaleOrderDtlm_bcode: TcxGridDBColumn
                  Caption = #21333#21495
                  DataBinding.FieldName = 'm_bcode'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 120
                end
              end
              object lvlSaleOrderDtl: TcxGridLevel
                Caption = #25171#26679#36135#21697
                GridView = viewSaleOrderDtl
              end
            end
          end
          object tsDtlSum: TcxTabSheet
            Caption = #36135#21697#27719#24635
            ImageIndex = 2
            object grdDtlSum: TcxGrid
              Left = 0
              Top = 0
              Width = 360
              Height = 239
              Align = alClient
              TabOrder = 0
              object viewDtlSum: TcxGridDBTableView
                NavigatorButtons.ConfirmDelete = False
                DataController.DataSource = dsDtlSum
                DataController.Summary.DefaultGroupSummaryItems = <>
                DataController.Summary.FooterSummaryItems = <>
                DataController.Summary.SummaryGroups = <>
                OptionsView.GroupByBox = False
                OptionsView.Indicator = True
                OptionsView.IndicatorWidth = 25
                OnCustomDrawIndicatorCell = viewSaleOrderCustomDrawIndicatorCell
                object cxGridDBColumn10: TcxGridDBColumn
                  Caption = #36135#21697#32534#30721
                  DataBinding.FieldName = 'p_code'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn11: TcxGridDBColumn
                  Caption = #21517#31216
                  DataBinding.FieldName = 'p_name'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn12: TcxGridDBColumn
                  Caption = #35268#26684
                  DataBinding.FieldName = 'p_spec'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object viewDtlSumbaseunitname: TcxGridDBColumn
                  Caption = #22522#26412#21333#20301
                  DataBinding.FieldName = 'baseunitname'
                  HeaderAlignmentHorz = taCenter
                end
                object cxGridDBColumn13: TcxGridDBColumn
                  Caption = #21333#20215
                  DataBinding.FieldName = 'price'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 80
                end
                object cxGridDBColumn14: TcxGridDBColumn
                  Caption = #25968#37327
                  DataBinding.FieldName = 'quantity'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 80
                end
                object cxGridDBColumn15: TcxGridDBColumn
                  Caption = #37329#39069
                  DataBinding.FieldName = 'amount'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 80
                end
                object cxGridDBColumn16: TcxGridDBColumn
                  Caption = #35828#26126
                  DataBinding.FieldName = 'explan'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 200
                end
                object viewDtlSumbcodeqty: TcxGridDBColumn
                  Caption = #25968#25454#28304
                  DataBinding.FieldName = 'bcodeqty'
                end
              end
              object lvlDtlSum: TcxGridLevel
                Caption = #36135#21697#27719#24635
                GridView = viewDtlSum
              end
            end
          end
          object tsBomSum: TcxTabSheet
            Caption = #29289#26009#27719#24635
            ImageIndex = 1
            object grdBomSum: TcxGrid
              Left = 0
              Top = 0
              Width = 360
              Height = 239
              Align = alClient
              TabOrder = 0
              object viewBomSum: TcxGridDBTableView
                NavigatorButtons.ConfirmDelete = False
                DataController.DataSource = dsBomSum
                DataController.Summary.DefaultGroupSummaryItems = <>
                DataController.Summary.FooterSummaryItems = <>
                DataController.Summary.SummaryGroups = <>
                OptionsView.GroupByBox = False
                OptionsView.Indicator = True
                OptionsView.IndicatorWidth = 25
                OnCustomDrawIndicatorCell = viewSaleOrderCustomDrawIndicatorCell
                object cxGridDBColumn1: TcxGridDBColumn
                  Caption = #36873#25321
                  DataBinding.FieldName = 'choice'
                  PropertiesClassName = 'TcxCheckBoxProperties'
                  Visible = False
                  HeaderAlignmentHorz = taCenter
                  Width = 30
                end
                object cxGridDBColumn2: TcxGridDBColumn
                  Caption = #36135#21697#32534#30721
                  DataBinding.FieldName = 'p_code'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn3: TcxGridDBColumn
                  Caption = #21517#31216
                  DataBinding.FieldName = 'p_name'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn4: TcxGridDBColumn
                  Caption = #35268#26684
                  DataBinding.FieldName = 'p_spec'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object viewBomSumunitname: TcxGridDBColumn
                  Caption = #22522#26412#21333#20301
                  DataBinding.FieldName = 'unitname'
                  HeaderAlignmentHorz = taCenter
                  Width = 50
                end
                object cxGridDBColumn5: TcxGridDBColumn
                  Caption = #21333#20215
                  DataBinding.FieldName = 'price'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 80
                end
                object cxGridDBColumn6: TcxGridDBColumn
                  Caption = #25968#37327
                  DataBinding.FieldName = 'quantity'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 80
                end
                object cxGridDBColumn7: TcxGridDBColumn
                  Caption = #37329#39069
                  DataBinding.FieldName = 'amount'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 80
                end
                object viewBomSumbookqty: TcxGridDBColumn
                  DataBinding.FieldName = 'bookqty'
                  GroupSummaryAlignment = taCenter
                  Width = 60
                end
                object viewBomSumfactqty: TcxGridDBColumn
                  DataBinding.FieldName = 'factqty'
                  GroupSummaryAlignment = taCenter
                  Width = 60
                end
                object viewBomSumneedqty: TcxGridDBColumn
                  DataBinding.FieldName = 'needqty'
                  GroupSummaryAlignment = taCenter
                  Width = 60
                end
                object viewBomSumbcodeqty: TcxGridDBColumn
                  Caption = #25968#25454#28304
                  DataBinding.FieldName = 'bcodeqty'
                  HeaderAlignmentHorz = taCenter
                  Width = 120
                end
                object cxGridDBColumn8: TcxGridDBColumn
                  Caption = #35828#26126
                  DataBinding.FieldName = 'explan'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 200
                end
                object viewBomSumColumn1: TcxGridDBColumn
                  DataBinding.FieldName = 'custom1'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn2: TcxGridDBColumn
                  DataBinding.FieldName = 'custom2'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn3: TcxGridDBColumn
                  DataBinding.FieldName = 'custom3'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn4: TcxGridDBColumn
                  DataBinding.FieldName = 'custom4'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn5: TcxGridDBColumn
                  DataBinding.FieldName = 'custom5'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn6: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom1'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn7: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom2'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn8: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom3'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn9: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom4'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object viewBomSumColumn10: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom5'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
              end
              object lvlBomSum: TcxGridLevel
                Caption = #29289#26009#27719#24635
                GridView = viewBomSum
              end
            end
          end
        end
        object sptBill: TcxSplitter
          Left = 0
          Top = 120
          Width = 360
          Height = 8
          Cursor = crVSplit
          HotZoneClassName = 'TcxXPTaskBarStyle'
          HotZone.SizePercent = 45
          AlignSplitter = salTop
          Control = grdSaleOrder
        end
      end
      object sptBom: TcxSplitter
        Left = 360
        Top = 0
        Width = 8
        Height = 390
        Cursor = crHSplit
        HotZoneClassName = 'TcxSimpleStyle'
        HotZone.SizePercent = 50
        Control = pnlBillInfo
      end
      object pnlBom: TPanel
        Left = 368
        Top = 0
        Width = 414
        Height = 390
        Align = alClient
        BevelOuter = bvNone
        TabOrder = 2
        object pgcBom: TcxPageControl
          Left = 0
          Top = 128
          Width = 414
          Height = 262
          ActivePage = cxTabSheet2
          Align = alClient
          TabOrder = 0
          ClientRectBottom = 262
          ClientRectRight = 414
          ClientRectTop = 23
          object cxTabSheet2: TcxTabSheet
            Caption = #29289#26009#26641
            ImageIndex = 0
            object TreeView1: TcxTreeView
              Left = 0
              Top = 0
              Width = 414
              Height = 239
              Align = alClient
              ParentFont = False
              TabOrder = 0
              HideSelection = False
              ReadOnly = True
              RowSelect = True
            end
          end
          object tsRaw: TcxTabSheet
            Caption = #26448#26009#21015#34920
            ImageIndex = 1
            object grdRaw: TcxGrid
              Left = 0
              Top = 0
              Width = 414
              Height = 239
              Align = alClient
              TabOrder = 0
              object viewRaw: TcxGridDBTableView
                NavigatorButtons.ConfirmDelete = False
                DataController.DataSource = dsBom
                DataController.Summary.DefaultGroupSummaryItems = <>
                DataController.Summary.FooterSummaryItems = <
                  item
                    Kind = skSum
                    FieldName = 'rawqty'
                    DisplayText = #24635#25968#65306
                  end>
                DataController.Summary.SummaryGroups = <>
                OptionsBehavior.AlwaysShowEditor = True
                OptionsBehavior.FocusCellOnTab = True
                OptionsBehavior.FocusFirstCellOnNewRecord = True
                OptionsBehavior.GoToNextCellOnEnter = True
                OptionsBehavior.FocusCellOnCycle = True
                OptionsBehavior.PullFocusing = True
                OptionsData.Appending = True
                OptionsView.ShowEditButtons = gsebForFocusedRecord
                OptionsView.Footer = True
                OptionsView.FooterMultiSummaries = True
                OptionsView.GroupByBox = False
                OptionsView.GroupFooters = gfVisibleWhenExpanded
              end
              object lvlRaw: TcxGridLevel
                Caption = #26448#26009#21015#34920
                GridView = viewRaw
              end
            end
          end
          object tsWorkProc: TcxTabSheet
            Caption = #24037#24207
            ImageIndex = 2
            object grdWorkProc: TcxGrid
              Left = 0
              Top = 0
              Width = 414
              Height = 239
              Align = alClient
              TabOrder = 0
              object viewWorkProc: TcxGridDBTableView
                NavigatorButtons.ConfirmDelete = False
                DataController.DataSource = dsWorkProc
                DataController.Summary.DefaultGroupSummaryItems = <>
                DataController.Summary.FooterSummaryItems = <>
                DataController.Summary.SummaryGroups = <>
                OptionsBehavior.FocusCellOnTab = True
                OptionsBehavior.FocusFirstCellOnNewRecord = True
                OptionsBehavior.GoToNextCellOnEnter = True
                OptionsBehavior.FocusCellOnCycle = True
                OptionsData.Appending = True
                OptionsView.ColumnAutoWidth = True
                OptionsView.GroupByBox = False
              end
              object lvlWorkProc: TcxGridLevel
                Caption = #24037#24207
                GridView = viewWorkProc
              end
            end
          end
          object tsRawTreeList: TcxTabSheet
            Caption = #29289#26009#21015#34920
            ImageIndex = 3
            object grdTree: TcxGrid
              Left = 0
              Top = 0
              Width = 414
              Height = 239
              Align = alClient
              TabOrder = 0
              object viewTree: TcxGridDBTableView
                NavigatorButtons.ConfirmDelete = False
                DataController.DataSource = dsTree
                DataController.Summary.DefaultGroupSummaryItems = <>
                DataController.Summary.FooterSummaryItems = <>
                DataController.Summary.SummaryGroups = <>
                OptionsBehavior.AlwaysShowEditor = True
                OptionsBehavior.FocusCellOnTab = True
                OptionsBehavior.FocusFirstCellOnNewRecord = True
                OptionsBehavior.GoToNextCellOnEnter = True
                OptionsBehavior.FocusCellOnCycle = True
                OptionsData.Deleting = False
                OptionsData.Editing = False
                OptionsData.Inserting = False
                OptionsView.GroupByBox = False
                object cxGridDBColumn9: TcxGridDBColumn
                  DataBinding.FieldName = 'orderno'
                  HeaderAlignmentHorz = taCenter
                  Width = 30
                end
                object cxGridDBColumn17: TcxGridDBColumn
                  DataBinding.FieldName = 'code'
                  HeaderAlignmentHorz = taCenter
                  Width = 80
                end
                object cxGridDBColumn18: TcxGridDBColumn
                  DataBinding.FieldName = 'name'
                  HeaderAlignmentHorz = taCenter
                  Width = 80
                end
                object cxGridDBColumn19: TcxGridDBColumn
                  DataBinding.FieldName = 'spec'
                  HeaderAlignmentHorz = taCenter
                  Width = 80
                end
                object cxGridDBColumn20: TcxGridDBColumn
                  DataBinding.FieldName = 'unitname'
                  HeaderAlignmentHorz = taCenter
                  Width = 50
                end
                object cxGridDBColumn21: TcxGridDBColumn
                  DataBinding.FieldName = 'rawqty'
                  HeaderAlignmentHorz = taCenter
                  Width = 80
                end
                object cxGridDBColumn22: TcxGridDBColumn
                  DataBinding.FieldName = 'wasterate'
                  HeaderAlignmentHorz = taCenter
                  Width = 80
                end
                object cxGridDBColumn23: TcxGridDBColumn
                  DataBinding.FieldName = 'subproduct'
                  PropertiesClassName = 'TcxButtonEditProperties'
                  Properties.Buttons = <
                    item
                      Default = True
                      Kind = bkEllipsis
                    end>
                  Width = 45
                end
                object cxGridDBColumn24: TcxGridDBColumn
                  DataBinding.FieldName = 'workprocid'
                  Visible = False
                  HeaderAlignmentHorz = taCenter
                end
                object cxGridDBColumn25: TcxGridDBColumn
                  DataBinding.FieldName = 'explan'
                  HeaderAlignmentHorz = taCenter
                  Width = 120
                end
                object cxGridDBColumn26: TcxGridDBColumn
                  DataBinding.FieldName = 'custom1'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object cxGridDBColumn27: TcxGridDBColumn
                  DataBinding.FieldName = 'custom2'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object cxGridDBColumn28: TcxGridDBColumn
                  DataBinding.FieldName = 'custom3'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object cxGridDBColumn29: TcxGridDBColumn
                  DataBinding.FieldName = 'custom4'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object cxGridDBColumn30: TcxGridDBColumn
                  DataBinding.FieldName = 'custom5'
                  HeaderAlignmentHorz = taCenter
                  Width = 100
                end
                object cxGridDBColumn31: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom1'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn32: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom2'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn33: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom3'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn34: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom4'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
                object cxGridDBColumn35: TcxGridDBColumn
                  DataBinding.FieldName = 'p_custom5'
                  HeaderAlignmentHorz = taCenter
                  Options.Editing = False
                  Width = 100
                end
              end
              object lvlTree: TcxGridLevel
                Caption = #29289#26009#21015#34920
                GridView = viewTree
              end
            end
          end
        end
        object grdBomVer: TcxGrid
          Left = 0
          Top = 0
          Width = 414
          Height = 120
          Align = alTop
          TabOrder = 1
          object viewBomVer: TcxGridDBTableView
            NavigatorButtons.ConfirmDelete = False
            DataController.DataSource = dsBomVer
            DataController.Summary.DefaultGroupSummaryItems = <>
            DataController.Summary.FooterSummaryItems = <>
            DataController.Summary.SummaryGroups = <>
            OptionsBehavior.FocusCellOnTab = True
            OptionsBehavior.FocusFirstCellOnNewRecord = True
            OptionsBehavior.GoToNextCellOnEnter = True
            OptionsBehavior.FocusCellOnCycle = True
            OptionsBehavior.PullFocusing = True
            OptionsData.Appending = True
            OptionsData.CancelOnExit = False
            OptionsView.ShowEditButtons = gsebAlways
            OptionsView.GroupByBox = False
            OptionsView.Indicator = True
            OptionsView.IndicatorWidth = 25
          end
          object lvlBomVer: TcxGridLevel
            GridView = viewBomVer
          end
        end
        object cxSplitter2: TcxSplitter
          Left = 0
          Top = 120
          Width = 414
          Height = 8
          Cursor = crVSplit
          HotZoneClassName = 'TcxXPTaskBarStyle'
          HotZone.SizePercent = 55
          AlignSplitter = salTop
          Control = grdBomVer
        end
      end
    end
    object tsSaleProduct: TcxTabSheet
      Caption = #23458#25143#23450#21046#36135#21697
      ImageIndex = 1
      object grdSaleProduct: TcxGrid
        Left = 0
        Top = 0
        Width = 782
        Height = 390
        Align = alClient
        TabOrder = 0
        object viewSaleProduct: TcxGridDBTableView
          NavigatorButtons.ConfirmDelete = False
          DataController.DataSource = dsSaleProduct
          DataController.Summary.DefaultGroupSummaryItems = <>
          DataController.Summary.FooterSummaryItems = <>
          DataController.Summary.SummaryGroups = <>
          OptionsView.GroupByBox = False
          OptionsView.Indicator = True
          OptionsView.IndicatorWidth = 25
          OnCustomDrawIndicatorCell = viewSaleOrderCustomDrawIndicatorCell
          object viewSaleProductchoice: TcxGridDBColumn
            Caption = #36873#25321
            DataBinding.FieldName = 'choice'
            PropertiesClassName = 'TcxCheckBoxProperties'
            HeaderAlignmentHorz = taCenter
            Width = 30
          end
          object viewSaleProductp_code: TcxGridDBColumn
            Caption = #36135#21697#32534#30721
            DataBinding.FieldName = 'p_code'
            HeaderAlignmentHorz = taCenter
            Width = 80
          end
          object viewSaleProductp_name: TcxGridDBColumn
            Caption = #21517#31216
            DataBinding.FieldName = 'p_name'
            HeaderAlignmentHorz = taCenter
            Width = 80
          end
          object viewSaleProductp_spec: TcxGridDBColumn
            Caption = #35268#26684
            DataBinding.FieldName = 'p_spec'
            HeaderAlignmentHorz = taCenter
            Width = 80
          end
          object viewSaleProductcode: TcxGridDBColumn
            Caption = #29289#26009#28165#21333#32534#30721
            DataBinding.FieldName = 'code'
            HeaderAlignmentHorz = taCenter
            Width = 80
          end
          object viewSaleProductname: TcxGridDBColumn
            Caption = #29289#26009#28165#21333#21517#31216
            DataBinding.FieldName = 'name'
            HeaderAlignmentHorz = taCenter
            Width = 80
          end
        end
        object lvlSaleProduct: TcxGridLevel
          Caption = #23458#25143#23450#21046#36135#21697
          GridView = viewSaleProduct
        end
      end
    end
  end
  object pnlBottom: TPanel [4]
    Left = 0
    Top = 478
    Width = 782
    Height = 55
    Align = alBottom
    BevelOuter = bvNone
    TabOrder = 2
    DesignSize = (
      782
      55)
    object btnMakeBill: TcxButton
      Left = 348
      Top = 15
      Width = 75
      Height = 25
      Anchors = [akLeft, akBottom]
      Caption = #25171#29256#29983#20135
      TabOrder = 0
      Kind = cxbkDropDown
    end
    object btnExcel: TcxButton
      Left = 436
      Top = 15
      Width = 80
      Height = 25
      Anchors = [akLeft, akBottom]
      Caption = #23548#20986'Excel'
      TabOrder = 3
      OnClick = btnExcelClick
      Glyph.Data = {
        36030000424D3603000000000000360000002800000010000000100000000100
        1800000000000003000000000000000000000000000000000000FF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF000000FF00FFFF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
        00FF000000FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FF000000000000000000FF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00000000
        0000000000000000000000FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FF000000000000000000000000000000000000000000FF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF84848484848484848484
        8484848484848484848484848484848484FF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00
        0000000000000000000000000000000000000000000000FF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FF000000FF00FFFF00FFFF00FFFF00FFFF00
        FFFF00FF000000FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00
        0000FF00FF840000840000FF00FF840000FF00FF000000FF00FFFF00FF000000
        000000000000000000000000000000000000FF00FFFF00FFFF00FFFF00FFFF00
        FFFF00FF000000FF00FFFF00FF000000FF00FFFF00FFFF00FFFF00FFFF00FF84
        0000FF0000840000FF0000840000FF0000840000FF0000FF00FFFF00FF000000
        FF00FF840000FF00FF840000840000FF0000840000FF0000840000FF00008400
        00FF0000840000FF00FFFF00FF000000FF00FFFF00FFFF00FFFF00FFFF00FFFF
        00FF000000FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF840000
        FF0000840000FF0000840000FF0000840000FF0000FF00FFFF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF0000840000FF0000840000FF0000840000FF
        0000840000FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF}
      SpeedButtonOptions.CanBeFocused = False
    end
    object btnBom: TcxButton
      Left = 18
      Top = 15
      Width = 75
      Height = 25
      Anchors = [akLeft, akBottom]
      Caption = #29289#26009#28165#21333
      TabOrder = 2
      OnClick = btnBomClick
    end
    object btnCancel: TcxButton
      Left = 691
      Top = 15
      Width = 75
      Height = 25
      Anchors = [akRight, akBottom]
      Cancel = True
      Caption = #36864#20986
      TabOrder = 1
      OnClick = btnCancelClick
    end
    object chkShowPic: TcxCheckBox
      Left = 600
      Top = 17
      Anchors = [akLeft, akBottom]
      Caption = #26174#31034#22270#29255
      Properties.ImmediatePost = True
      TabOrder = 4
      OnClick = chkShowPicClick
      Width = 93
    end
    object btnCheck: TcxButton
      Left = 102
      Top = 15
      Width = 75
      Height = 25
      Anchors = [akLeft, akBottom]
      Caption = #23457#26680
      TabOrder = 5
      Visible = False
      OnClick = btnCheckClick
      Glyph.Data = {
        36030000424D3603000000000000360000002800000010000000100000000100
        1800000000000003000000000000000000000000000000000000FF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF80808080
        8080FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF808080FF00FFFF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00800000800000
        8000FF00FF808080FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FF008000008000008000008000008000FF00FF808080FF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF00800000800000800000800000
        8000008000FF00FF808080FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
        008000008000008000008000FF00FF008000008000008000FF00FF808080FF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF008000008000FF00FFFF00FFFF
        00FF008000008000FF00FF808080FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FF008000008000008000FF00FF8080
        80FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
        00FFFF00FF008000008000FF00FF808080FF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF008000008000FF00
        FF808080FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
        00FFFF00FFFF00FF008000008000FF00FF808080FF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF0080000080
        00FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
        00FFFF00FFFF00FFFF00FFFF00FF008000FF00FFFF00FFFF00FFFF00FFFF00FF
        FF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00
        FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF
        00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FFFF00FF}
    end
    object btnSave: TcxButton
      Tag = 205
      Left = 232
      Top = 15
      Width = 100
      Height = 25
      Anchors = [akLeft, akBottom]
      Caption = #20445#23384#20026#38144#21806#25253#20215#21333
      TabOrder = 6
      Visible = False
      OnClick = btnSaveClick
      LookAndFeel.Kind = lfUltraFlat
    end
  end
  inherited MainDataSource: TDataSource
    Left = 261
    Top = 89
  end
  inherited ImageList1: TImageList
    Left = 23
    Top = 179
  end
  inherited MainMenu1: TMainMenu
    Left = 14
    Top = 100
  end
  inherited ActionList1: TActionList
    Left = 77
    Top = 163
  end
  inherited PopupMenu1: TPopupMenu
    Left = 56
  end
  inherited qryDynDtl: TUniQuery
    Left = 24
    Top = 257
  end
  inherited styColor: TcxStyleRepository
    Left = 108
    Top = 192
  end
  object dsClient: TDataSource
    DataSet = cdsClient
    Left = 184
    Top = 97
  end
  object cdsClient: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 132
    Top = 85
    object cdsClienttraderid: TIntegerField
      FieldName = 'traderid'
      OnChange = cdsClienttraderidChange
    end
    object cdsClientproductid: TIntegerField
      FieldName = 'productid'
    end
  end
  object pmSelSOrder: TPopupMenu
    Left = 728
    Top = 45
    object muAllSOrder: TMenuItem
      Caption = #36873#25321#38144#21806#25253#20215#21333
      OnClick = muAllSOrderClick
    end
  end
  object dsSaleOrderDtl: TDataSource
    DataSet = cdsSaleOrderDtl
    Left = 200
    Top = 310
  end
  object cdsSaleOrderDtl: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspSaleOrderDtl'
    AfterScroll = cdsSaleOrderDtlAfterScroll
    Left = 144
    Top = 326
  end
  object dspSaleOrderDtl: TDataSetProvider
    DataSet = qrySaleOrderDtl
    Left = 88
    Top = 306
  end
  object qrySaleOrderDtl: TUniQuery
    DataTypeMap = <>
    Connection = MainDM.UniConn
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Left = 24
    Top = 322
  end
  object cdsSaleOrder: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 272
    Top = 154
    object cdsSaleOrderchoice: TBooleanField
      DisplayLabel = #36873#25321
      FieldName = 'choice'
      OnChange = cdsSaleOrderchoiceChange
    end
    object cdsSaleOrderbid: TIntegerField
      FieldName = 'bid'
    end
    object cdsSaleOrderbdate: TDateTimeField
      DisplayLabel = #26085#26399
      FieldName = 'bdate'
    end
    object cdsSaleOrderbcode: TStringField
      DisplayLabel = #21333#21495
      FieldName = 'bcode'
      Size = 40
    end
    object cdsSaleOrderamount: TFloatField
      DisplayLabel = #24635#37329#39069
      FieldName = 'amount'
    end
    object cdsSaleOrderrevdate: TDateTimeField
      DisplayLabel = #21457#36135#26085#26399
      FieldName = 'revdate'
    end
    object cdsSaleOrderforwardamt: TFloatField
      DisplayLabel = #39044#25910#27454
      FieldName = 'forwardamt'
    end
    object cdsSaleOrderdeptname: TStringField
      DisplayLabel = #37096#38376
      FieldName = 'deptname'
      Size = 60
    end
    object cdsSaleOrderempname: TStringField
      DisplayLabel = #19994#21153#21592
      FieldName = 'empname'
      Size = 40
    end
    object cdsSaleOrderremark: TStringField
      DisplayLabel = #22791#27880
      FieldName = 'remark'
      Size = 200
    end
  end
  object qrySaleProduct: TUniQuery
    DataTypeMap = <>
    Connection = MainDM.UniConn
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Left = 516
    Top = 114
  end
  object dspSaleProduct: TDataSetProvider
    DataSet = qrySaleProduct
    Left = 572
    Top = 94
  end
  object cdsSaleProduct: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspSaleProduct'
    Left = 624
    Top = 78
  end
  object dsSaleProduct: TDataSource
    DataSet = cdsSaleProduct
    Left = 688
    Top = 98
  end
  object cxStyleRepository1: TcxStyleRepository
    Left = 796
    Top = 506
    PixelsPerInch = 96
  end
  object dsSaleOrder: TDataSource
    DataSet = cdsSaleOrder
    Left = 368
    Top = 162
  end
  object cdsBomSum: TClientDataSet
    Aggregates = <>
    FieldDefs = <>
    IndexDefs = <>
    Params = <>
    ProviderName = 'dspBomSum'
    StoreDefs = True
    Left = 356
    Top = 426
    object cdsBomSumchoice: TBooleanField
      FieldName = 'choice'
    end
    object cdsBomSumproductid: TIntegerField
      FieldName = 'productid'
    end
    object cdsBomSump_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object cdsBomSump_name: TStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsBomSump_spec: TStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object cdsBomSumprice: TFloatField
      FieldName = 'price'
    end
    object cdsBomSumquantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsBomSumamount: TFloatField
      FieldName = 'amount'
    end
    object cdsBomSumexplan: TStringField
      FieldName = 'explan'
      Size = 2000
    end
    object cdsBomSumbcodeqty: TStringField
      FieldName = 'bcodeqty'
      Size = 2000
    end
    object cdsBomSumcustom1: TStringField
      DisplayLabel = #33258#23450#20041'1'
      FieldName = 'custom1'
      Size = 200
    end
    object cdsBomSumcustom2: TStringField
      DisplayLabel = #33258#23450#20041'2'
      FieldName = 'custom2'
      Size = 200
    end
    object cdsBomSumcustom3: TStringField
      DisplayLabel = #33258#23450#20041'3'
      FieldName = 'custom3'
      Size = 200
    end
    object cdsBomSumcustom4: TStringField
      DisplayLabel = #33258#23450#20041'4'
      FieldName = 'custom4'
      Size = 200
    end
    object cdsBomSumcustom5: TStringField
      DisplayLabel = #33258#23450#20041'5'
      FieldName = 'custom5'
      Size = 200
    end
    object cdsBomSump_custom1: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'1'
      FieldName = 'p_custom1'
      Size = 200
    end
    object cdsBomSump_custom2: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'2'
      FieldName = 'p_custom2'
      Size = 200
    end
    object cdsBomSump_custom3: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'3'
      FieldName = 'p_custom3'
      Size = 200
    end
    object cdsBomSump_custom4: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'4'
      FieldName = 'p_custom4'
      Size = 200
    end
    object cdsBomSump_custom5: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'5'
      FieldName = 'p_custom5'
      Size = 200
    end
    object cdsBomSumunitname: TStringField
      FieldName = 'unitname'
      Size = 60
    end
    object cdsBomSumproductpid: TIntegerField
      FieldName = 'productpid'
    end
    object cdsBomSumbookqty: TFloatField
      DisplayLabel = #36134#38754#24211#23384
      FieldName = 'bookqty'
    end
    object cdsBomSumfactqty: TFloatField
      DisplayLabel = #23454#38469#24211#23384
      FieldName = 'factqty'
    end
    object cdsBomSumneedqty: TFloatField
      DisplayLabel = #26412#27425#38656#27714
      FieldName = 'needqty'
    end
  end
  object dsBomSum: TDataSource
    DataSet = cdsBomSum
    Left = 416
    Top = 426
  end
  object cdsDtlSum: TClientDataSet
    Aggregates = <>
    FieldDefs = <>
    IndexDefs = <>
    Params = <>
    ProviderName = 'dspSaleOrderDtl'
    StoreDefs = True
    Left = 32
    Top = 386
    object cdsDtlSumproductid: TIntegerField
      FieldName = 'productid'
    end
    object cdsDtlSump_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object cdsDtlSump_name: TStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsDtlSump_spec: TStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object cdsDtlSumprice: TFloatField
      FieldName = 'price'
    end
    object cdsDtlSumquantity: TFloatField
      FieldName = 'quantity'
    end
    object cdsDtlSumamount: TFloatField
      FieldName = 'amount'
    end
    object cdsDtlSumbcodeqty: TStringField
      FieldName = 'bcodeqty'
      Size = 200
    end
    object cdsDtlSumexplan: TStringField
      FieldName = 'explan'
      Size = 2000
    end
    object cdsDtlSumunitname: TStringField
      FieldName = 'unitname'
      Size = 60
    end
  end
  object dsDtlSum: TDataSource
    DataSet = cdsDtlSum
    Left = 88
    Top = 386
  end
  object dsBom: TDataSource
    DataSet = qryBom
    Left = 544
    Top = 275
  end
  object dlgSaveExportExcel: TSaveDialog
    Filter = 'Excel|.xls'
    Left = 737
    Top = 5
  end
  object cdsTree: TClientDataSet
    Aggregates = <>
    Params = <>
    Left = 736
    Top = 313
    object IntegerField3: TIntegerField
      FieldName = 'bomid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object StringField17: TStringField
      DisplayLabel = #24207#21495
      FieldName = 'orderno'
      Size = 40
    end
    object StringField18: TStringField
      DisplayLabel = #26448#26009#32534#30721
      FieldName = 'code'
      Size = 40
    end
    object cdsTreename: TStringField
      DisplayLabel = #26448#26009#21517#31216
      FieldName = 'name'
      Size = 60
    end
    object IntegerField4: TIntegerField
      DisplayLabel = #26448#26009#21517#31216
      FieldName = 'rawproductid'
    end
    object WideStringField1: TWideStringField
      DisplayLabel = #35268#26684
      FieldName = 'spec'
      Size = 60
    end
    object WideStringField2: TWideStringField
      DisplayLabel = #21333#20301
      FieldName = 'unitname'
      ProviderFlags = []
      Size = 40
    end
    object BCDField1: TFloatField
      DisplayLabel = #26448#26009#25968#37327
      FieldName = 'rawqty'
    end
    object BCDField2: TFloatField
      DisplayLabel = #24223#21697#29575'%'
      FieldName = 'wasterate'
    end
    object StringField19: TStringField
      DisplayLabel = #26367#20195#21697
      FieldKind = fkCalculated
      FieldName = 'subproduct'
      ProviderFlags = []
      Size = 200
      Calculated = True
    end
    object StringField20: TStringField
      DisplayLabel = #35828#26126
      FieldName = 'explan'
      Size = 200
    end
    object IntegerField5: TIntegerField
      FieldName = 'worklineid'
    end
    object IntegerField6: TIntegerField
      DisplayLabel = #24037#24207
      FieldName = 'workprocid'
    end
    object IntegerField7: TIntegerField
      FieldName = 'rawno'
    end
    object StringField21: TStringField
      DisplayLabel = #33258#23450#20041'1'
      FieldName = 'custom1'
      Size = 200
    end
    object StringField22: TStringField
      DisplayLabel = #33258#23450#20041'2'
      FieldName = 'custom2'
      Size = 200
    end
    object StringField23: TStringField
      DisplayLabel = #33258#23450#20041'3'
      FieldName = 'custom3'
      Size = 200
    end
    object StringField24: TStringField
      DisplayLabel = #33258#23450#20041'4'
      FieldName = 'custom4'
      Size = 200
    end
    object StringField25: TStringField
      DisplayLabel = #33258#23450#20041'5'
      FieldName = 'custom5'
      Size = 200
    end
    object StringField26: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'1'
      FieldName = 'p_custom1'
      ProviderFlags = []
      Size = 100
    end
    object StringField27: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'2'
      FieldName = 'p_custom2'
      ProviderFlags = []
      Size = 100
    end
    object StringField28: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'3'
      FieldName = 'p_custom3'
      ProviderFlags = []
      Size = 100
    end
    object StringField29: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'4'
      FieldName = 'p_custom4'
      ProviderFlags = []
      Size = 100
    end
    object StringField30: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'5'
      FieldName = 'p_custom5'
      ProviderFlags = []
      Size = 100
    end
  end
  object dsTree: TDataSource
    DataSet = cdsTree
    Left = 736
    Top = 361
  end
  object qryBom: TUniQuery
    SQLInsert.Strings = (
      'INSERT INTO td_productbom'
      
        '  (bomid, rawproductid, rawno, rawbomid, rawqty, wasterate, expl' +
        'an, orderno, worklineid, workprocid, custom1, custom2, custom3, ' +
        'custom4, custom5, create_by, traderid)'
      'VALUES'
      
        '  (:bomid, :rawproductid, :rawno, :rawbomid, :rawqty, :wasterate' +
        ', :explan, :orderno, :worklineid, :workprocid, :custom1, :custom' +
        '2, :custom3, :custom4, :custom5, :create_by, :traderid)')
    SQLDelete.Strings = (
      'DELETE FROM td_productbom'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND ra' +
        'wno = :Old_rawno')
    SQLUpdate.Strings = (
      'UPDATE td_productbom'
      'SET'
      
        '  bomid = :bomid, rawproductid = :rawproductid, rawno = :rawno, ' +
        'rawbomid = :rawbomid, rawqty = :rawqty, wasterate = :wasterate, ' +
        'explan = :explan, orderno = :orderno, worklineid = :worklineid, ' +
        'workprocid = :workprocid, custom1 = :custom1, custom2 = :custom2' +
        ', custom3 = :custom3, custom4 = :custom4, custom5 = :custom5, cr' +
        'eate_by = :create_by, traderid = :traderid'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND ra' +
        'wno = :Old_rawno')
    SQLLock.Strings = (
      'SELECT * FROM td_productbom'
      'WITH (UPDLOCK, ROWLOCK, HOLDLOCK)'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND ra' +
        'wno = :Old_rawno')
    SQLRefresh.Strings = (
      
        'SELECT bomid, rawproductid, rawno, rawbomid, rawqty, wasterate, ' +
        'explan, orderno, worklineid, workprocid, custom1, custom2, custo' +
        'm3, custom4, custom5, create_by, traderid FROM td_productbom'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND ra' +
        'wno = :Old_rawno')
    DataTypeMap = <>
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select b.*,p.code,p.spec,u.unitname'
      
        '  ,p.custom1 p_custom1,p.custom2 p_custom2,p.custom3 p_custom3,p' +
        '.custom4 p_custom4,p.custom5 p_custom5'
      '  from td_productbom b,td_product p,td_unitprice u'
      
        '  where b.rawproductid=p.p_id and b.rawproductid=u.productid and' +
        ' u.baseunit=1'
      '  order by b.orderno')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 500
    Top = 277
  end
  object qryBomSub: TUniQuery
    SQLInsert.Strings = (
      'INSERT INTO td_productbomsub'
      
        '  (bomid, rawproductid, rawno, subrawid, subbomid, rate, explan,' +
        ' productrawno)'
      'VALUES'
      
        '  (:bomid, :rawproductid, :rawno, :subrawid, :subbomid, :rate, :' +
        'explan, :productrawno)')
    SQLDelete.Strings = (
      'DELETE FROM td_productbomsub'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND su' +
        'brawid = :Old_subrawid')
    SQLUpdate.Strings = (
      'UPDATE td_productbomsub'
      'SET'
      
        '  bomid = :bomid, rawproductid = :rawproductid, rawno = :rawno, ' +
        'subrawid = :subrawid, subbomid = :subbomid, rate = :rate, explan' +
        ' = :explan, productrawno = :productrawno'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND su' +
        'brawid = :Old_subrawid')
    SQLLock.Strings = (
      'SELECT * FROM td_productbomsub'
      'WITH (UPDLOCK, ROWLOCK, HOLDLOCK)'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND su' +
        'brawid = :Old_subrawid')
    SQLRefresh.Strings = (
      
        'SELECT bomid, rawproductid, rawno, subrawid, subbomid, rate, exp' +
        'lan, productrawno FROM td_productbomsub'
      'WHERE'
      
        '  bomid = :Old_bomid AND rawproductid = :Old_rawproductid AND su' +
        'brawid = :Old_subrawid')
    DataTypeMap = <>
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select m.*,p.code p_code,p.name p_name,p.spec p_spec,u.unitname,'
      '  b.rawqty*(1+b.wasterate/100)*m.rate as quantity'
      '  from td_productbomsub m'
      '  left join td_product p on m.subrawid=p.p_id'
      '  left join td_unitprice u on u.productid=p.p_id and baseunit=1'
      
        '  left join td_productbom b on b.bomid=m.bomid and m.rawproducti' +
        'd=b.rawproductid and m.rawno=b.rawno'
      '  where m.bomid=0'
      'order by m.rawno,m.subrawid')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 504
    Top = 349
    object qryBomSubbomid: TIntegerField
      FieldName = 'bomid'
    end
    object qryBomSubrawproductid: TIntegerField
      FieldName = 'rawproductid'
    end
    object qryBomSubrawno: TStringField
      FieldName = 'rawno'
      Size = 40
    end
    object qryBomSubsubrawid: TIntegerField
      FieldName = 'subrawid'
    end
    object qryBomSubsubbomid: TIntegerField
      FieldName = 'subbomid'
    end
    object qryBomSubrate: TFloatField
      FieldName = 'rate'
    end
    object qryBomSubexplan: TStringField
      FieldName = 'explan'
      Size = 200
    end
    object qryBomSubproductrawno: TIntegerField
      FieldName = 'productrawno'
    end
    object qryBomSubp_code: TStringField
      FieldName = 'p_code'
      Size = 40
    end
    object qryBomSubp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object qryBomSubp_spec: TWideStringField
      FieldName = 'p_spec'
      Size = 60
    end
    object qryBomSubunitname: TWideStringField
      FieldName = 'unitname'
      Size = 40
    end
    object qryBomSubquantity: TFloatField
      FieldName = 'quantity'
    end
  end
  object qryWorkProc: TUniQuery
    SQLInsert.Strings = (
      'INSERT INTO td_productbomProc'
      
        '  (bomid, pno, orderno, explan, workprocid, workshopid, workcent' +
        'erid, manhour, pretime, empid)'
      'VALUES'
      
        '  (:bomid, :pno, :orderno, :explan, :workprocid, :workshopid, :w' +
        'orkcenterid, :manhour, :pretime, :empid)')
    SQLDelete.Strings = (
      'DELETE FROM td_productbomProc'
      'WHERE'
      '  bomid = :Old_bomid AND workprocid = :Old_workprocid')
    SQLUpdate.Strings = (
      'UPDATE td_productbomProc'
      'SET'
      
        '  bomid = :bomid, pno = :pno, orderno = :orderno, explan = :expl' +
        'an, workprocid = :workprocid, workshopid = :workshopid, workcent' +
        'erid = :workcenterid, manhour = :manhour, pretime = :pretime, em' +
        'pid = :empid'
      'WHERE'
      '  bomid = :Old_bomid AND workprocid = :Old_workprocid')
    SQLLock.Strings = (
      'SELECT * FROM td_productbomProc'
      'WITH (UPDLOCK, ROWLOCK, HOLDLOCK)'
      'WHERE'
      '  bomid = :Old_bomid AND workprocid = :Old_workprocid')
    SQLRefresh.Strings = (
      
        'SELECT bomid, pno, orderno, explan, workprocid, workshopid, work' +
        'centerid, manhour, pretime FROM td_productbomProc'
      'WHERE'
      '  bomid = :Old_bomid AND workprocid = :Old_workprocid')
    DataTypeMap = <>
    Connection = MainDM.UniConn
    SQL.Strings = (
      
        'select m.*,wp.code,wp.name,ws.name workshopname,wc.name centerna' +
        'me'
      '  from td_productbomProc m'
      '  left  join td_workproc wp on m.workprocid = wp.workprocid'
      '   left  join td_workshop ws on m.workshopid=ws.workshopid'
      '  left join td_workcenter wc on wc.workcenterid=m.workcenterid'
      '    where m.bomid=:Bomid'
      '  order by m.orderno')
    CachedUpdates = True
    Options.PrepareUpdateSQL = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    Options.AutoPrepare = True
    Left = 512
    Top = 405
    ParamData = <
      item
        DataType = ftUnknown
        Name = 'Bomid'
      end>
  end
  object qryBomVer: TUniQuery
    SQLInsert.Strings = (
      'INSERT INTO td_productbomver'
      
        '  (bomid, code, name, productid, manhour, quantity, pretime, wor' +
        'klineid, remark, state, create_by, check_by, create_time, update' +
        '_time, custom1, custom2, custom3, custom4, custom5, defbom, cost' +
        ', salereprice, pic, postfix)'
      'VALUES'
      
        '  (:bomid, :code, :name, :productid, :manhour, :quantity, :preti' +
        'me, :worklineid, :remark, :state, :create_by, :check_by, :create' +
        '_time, :update_time, :custom1, :custom2, :custom3, :custom4, :cu' +
        'stom5, :defbom, :cost, :salereprice, :pic, :postfix)')
    SQLDelete.Strings = (
      'DELETE FROM td_productbomver'
      'WHERE'
      '  bomid = :Old_bomid')
    SQLUpdate.Strings = (
      'UPDATE td_productbomver'
      'SET'
      
        '  bomid = :bomid, code = :code, name = :name, productid = :produ' +
        'ctid, manhour = :manhour, quantity = :quantity, pretime = :preti' +
        'me, worklineid = :worklineid, remark = :remark, state = :state, ' +
        'create_by = :create_by, check_by = :check_by, create_time = :cre' +
        'ate_time, update_time = :update_time, custom1 = :custom1, custom' +
        '2 = :custom2, custom3 = :custom3, custom4 = :custom4, custom5 = ' +
        ':custom5, defbom = :defbom, cost = :cost, salereprice = :salerep' +
        'rice, pic = :pic, postfix = :postfix'
      'WHERE'
      '  bomid = :Old_bomid')
    SQLLock.Strings = (
      'SELECT * FROM td_productbomver'
      'WITH (UPDLOCK, ROWLOCK, HOLDLOCK)'
      'WHERE'
      '  bomid = :Old_bomid')
    SQLRefresh.Strings = (
      
        'SELECT bomid, code, name, productid, manhour, quantity, pretime,' +
        ' remark, state, create_by, check_by, create_time, update_time, c' +
        'ustom1, custom2, custom3, custom4, custom5, defbom, cost, salere' +
        'price, pic, postfix FROM td_productbomver'
      'WHERE'
      '  bomid = :Old_bomid')
    DataTypeMap = <>
    Connection = MainDM.UniConn
    SQL.Strings = (
      'select * from td_productbomver')
    CachedUpdates = True
    Options.SetFieldsReadOnly = False
    Options.RequiredFields = False
    Options.QueryRecCount = True
    AfterScroll = qryBomVerAfterScroll
    Left = 404
    Top = 99
  end
  object dsWorkProc: TDataSource
    DataSet = qryWorkProc
    Left = 572
    Top = 433
  end
  object dsBomVer: TDataSource
    DataSet = qryBomVer
    Left = 448
    Top = 136
  end
  object cdsBom: TClientDataSet
    Aggregates = <>
    Params = <>
    ProviderName = 'dspBom'
    Left = 140
    Top = 269
    object cdsBombomid: TIntegerField
      FieldName = 'bomid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
      Required = True
    end
    object cdsBomorderno: TStringField
      DisplayLabel = #24207#21495
      FieldName = 'orderno'
      Size = 40
    end
    object cdsBomp_code: TStringField
      DisplayLabel = #26448#26009#32534#30721
      FieldName = 'p_code'
      ProviderFlags = []
      Size = 40
    end
    object cdsBomrawproductid: TIntegerField
      DisplayLabel = #26448#26009#21517#31216
      FieldName = 'rawproductid'
      ProviderFlags = [pfInUpdate, pfInWhere, pfInKey]
    end
    object cdsBomrawbomid: TIntegerField
      DisplayLabel = #23376#20214#29289#26009#29256#26412
      FieldName = 'rawbomid'
    end
    object cdsBomspec: TWideStringField
      DisplayLabel = #35268#26684
      FieldName = 'spec'
      ProviderFlags = []
      Size = 60
    end
    object cdsBomunitname: TWideStringField
      DisplayLabel = #21333#20301
      FieldName = 'unitname'
      ProviderFlags = []
      Size = 40
    end
    object cdsBomrawqty: TFloatField
      DisplayLabel = #26448#26009#25968#37327
      FieldName = 'rawqty'
      Required = True
    end
    object cdsBomwasterate: TFloatField
      DisplayLabel = #24223#21697#29575'%'
      FieldName = 'wasterate'
    end
    object cdsBomsubproduct: TStringField
      DisplayLabel = #26367#20195#21697
      FieldName = 'subproduct'
      ProviderFlags = []
      Size = 200
    end
    object cdsBomexplan: TStringField
      DisplayLabel = #35828#26126
      FieldName = 'explan'
      Size = 200
    end
    object cdsBomworklineid: TIntegerField
      DisplayLabel = #24037#33402#27969#31243
      FieldName = 'worklineid'
    end
    object cdsBomworkprocid: TIntegerField
      DisplayLabel = #24037#24207
      FieldName = 'workprocid'
    end
    object cdsBomrawno: TIntegerField
      FieldName = 'rawno'
    end
    object cdsBomcustom1: TStringField
      DisplayLabel = #33258#23450#20041'1'
      FieldName = 'custom1'
      Size = 200
    end
    object cdsBomcustom2: TStringField
      DisplayLabel = #33258#23450#20041'2'
      FieldName = 'custom2'
      Size = 200
    end
    object cdsBomcustom3: TStringField
      DisplayLabel = #33258#23450#20041'3'
      FieldName = 'custom3'
      Size = 200
    end
    object cdsBomcustom4: TStringField
      DisplayLabel = #33258#23450#20041'4'
      FieldName = 'custom4'
      Size = 200
    end
    object cdsBomcustom5: TStringField
      DisplayLabel = #33258#23450#20041'5'
      FieldName = 'custom5'
      Size = 200
    end
    object cdsBomp_custom1: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'1'
      FieldName = 'p_custom1'
      ProviderFlags = []
      Size = 100
    end
    object cdsBomp_custom2: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'2'
      FieldName = 'p_custom2'
      ProviderFlags = []
      Size = 100
    end
    object cdsBomp_custom3: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'3'
      FieldName = 'p_custom3'
      ProviderFlags = []
      Size = 100
    end
    object cdsBomp_custom4: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'4'
      FieldName = 'p_custom4'
      ProviderFlags = []
      Size = 100
    end
    object cdsBomp_custom5: TStringField
      DisplayLabel = #36135#21697#33258#23450#20041'5'
      FieldName = 'p_custom5'
      ProviderFlags = []
      Size = 100
    end
    object cdsBomcreate_by: TIntegerField
      DisplayLabel = #21019#24314#20154
      FieldName = 'create_by'
    end
    object cdsBomtraderid: TIntegerField
      DisplayLabel = #20379#24212#21830
      FieldName = 'traderid'
    end
    object cdsBomp_name: TWideStringField
      FieldName = 'p_name'
      Size = 60
    end
    object cdsBomrawbomname: TStringField
      FieldName = 'rawbomname'
      Size = 60
    end
    object cdsBomt_name: TStringField
      FieldName = 't_name'
      Size = 60
    end
    object cdsBomlength: TFloatField
      FieldName = 'length'
    end
    object cdsBomwidth: TFloatField
      FieldName = 'width'
    end
    object cdsBomheight: TFloatField
      FieldName = 'height'
    end
    object cdsBombid: TIntegerField
      FieldName = 'bid'
    end
    object cdsBombno: TIntegerField
      FieldName = 'bno'
    end
    object cdsBomproductpid: TIntegerField
      FieldName = 'productpid'
    end
  end
end
